﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MainTemplate.Master" AutoEventWireup="true" CodeBehind="SearchPage.aspx.cs" Inherits="AlexandriaPressWebsite.MasterPages.UserPages.SearchPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="mainDoc" runat="server">
    <asp:Button ID="allTitlesButton" runat="server" Text="All Titles" 
        CssClass="formButton" onclick="allTitlesButton_Click1" />
    <asp:Button ID="allAuthorsButton" runat="server" Text="All Authors" 
        CssClass="formButton" onclick="allAuthorsButton_Click" />
    <asp:Button ID="mostPopularButton" runat="server" Text="Most Popular" 
        CssClass="formButton" onclick="mostPopularButton_Click" />
<table>
        <tr>
            <td>
                <asp:Label ID="SearchLabel" runat="server" CssClass="simplelabel">Search: &nbsp</asp:Label></td>
            <td>
                <asp:TextBox ID="searchItem" runat="server" CssClass="text"></asp:TextBox>
            </td>
            <td>
                
        <asp:DropDownList ID="searchTypeDropDownList" runat="server" CssClass="secondaryList" 
          >
            <asp:ListItem Value="Title">Title</asp:ListItem>
            <asp:ListItem Value="Author">Author</asp:ListItem>
            <asp:ListItem Value="Genre">Genre</asp:ListItem>
        </asp:DropDownList>
            </td>
            <td>
                <asp:Button ID="searchButton" runat="server"
                    Text="GO" onclick="searchButton_Click" CssClass="formButton" />
            </td>
      
        </tr>
       
    </table>
  
        <asp:Label ID="searchResultLabel" runat="server" CssClass="parag" 
        ForeColor="Red"></asp:Label>
   
        <br />
      <asp:GridView ID="searchGridView1" runat="server" AutoGenerateColumns="False"    
               RowStyle-BorderStyle="None"  
               PagerSettings-PageButtonCount="10" 
               GridLines="None"
               AllowPaging="True" 
               OnPageIndexChanging="searchGridView1_OnPageIndexChanging" 
               BorderStyle="None" CssClass="grid" PageSize="8">
               
            <PagerSettings PageButtonCount="10" />
<RowStyle BorderStyle="None"></RowStyle>
            <Columns>
            <asp:TemplateField HeaderText = "Search Results">
                <ItemTemplate>
                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("BookCover") %>' CssClass="smallImage2" /><br />
                    TITLE: <asp:Label ID="BookTitle" runat="server" Text='<%# Eval("Title") %>'></asp:Label><br/>
                    AUTHOR: <asp:Label ID="BookAuthor" runat="server" Text='<%# Eval("Author") %>'></asp:Label><br />
                    GENRE: <asp:Label ID="BookGenre" runat="server" Text='<%# Eval("Genre") %>'></asp:Label><br />
                    QUANTITY IN STOCK: <asp:Label ID="BookQuantity" runat="server" Text='<%# Eval("QuantityInStock") %>'></asp:Label><br />
                    PRICE: <asp:Label ID="BookPrice" runat="server" Text='<%# Eval("Price") %>'></asp:Label><br /><br />
                    <a href="TitleDetailsPage.aspx?id=<%# Eval("ID") %>">More>></a>
                </ItemTemplate>                   
            </asp:TemplateField>            
            </Columns>
        </asp:GridView>   
        <br />         
             <asp:GridView ID="searchAuthorGridView1" runat="server" AutoGenerateColumns="False"
                     RowStyle-BorderStyle="None"  
                     PagerSettings-PageButtonCount="10" 
                     GridLines="None"
                     AllowPaging="True" 
                     OnPageIndexChanging="searchAuthorGridView1_OnPageIndexChanging" 
                     BorderStyle="None" CssClass="grid" PageSize="8">
            <PagerSettings PageButtonCount="10" /> 
<RowStyle BorderStyle="None"></RowStyle>
            <Columns>
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:Image ID="Image2" runat="server" ImageUrl='<%# Eval("ProfilePic") %>' CssClass="smallImage2"/><br /><br />
                    AUTHOR: <asp:Label ID="Author" runat="server" Text='<%# Eval("Author") %>'></asp:Label><br />
                    GENDER: <asp:Label ID="Gender" runat="server" Text='<%# Eval("Gender") %>'></asp:Label><br />
                    DATE JOINED: <asp:Label ID="DateJoined" runat="server" Text='<%# Eval("DateJoined") %>'></asp:Label><br /><br />
                    <a href="AuthorDetailsPage.aspx?id=<%# Eval("UserID") %>">More>></a>
                </ItemTemplate>                   
            </asp:TemplateField>            
            </Columns>
        </asp:GridView>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="formDoc" runat="server">
</asp:Content>
